﻿using System;
using System.Windows.Forms;

namespace HYCodeBase.WinForm.WinFormRemindSuit
{
	internal class BoolReflectPropertySeter : GeneralReflectPropertySeter<bool>, IAttributeSeter
	{
		private BoolReflectPropertySeter()
		{
		}

		internal static BoolReflectPropertySeter GetBoolReflectPropertySeter()
		{
			if (BoolReflectPropertySeter.m_singleTag == null)
			{
				BoolReflectPropertySeter.m_singleTag = new BoolReflectPropertySeter();
			}
			return BoolReflectPropertySeter.m_singleTag;
		}

		public bool TrySetOneAttribute(ref System.Windows.Forms.Control inputControl, AttributeInformationBean inputAttribute)
		{
			return base.TrySetOneAttributeGeneral(ref inputControl, inputAttribute, null);
		}

		protected override bool GetValueOfString(string inputStr)
		{
			return bool.Parse(inputStr);
		}

		private static BoolReflectPropertySeter m_singleTag;
	}
}
